Skip to content

chore: config improvements#32

Merged
markovejnovic merged 47 commits into
mainfrom
docs/cookbook-and-config
Jun 27, 2026
Merged

chore: config improvements#32
markovejnovic merged 47 commits into
mainfrom
docs/cookbook-and-config

Conversation

@markovejnovic

@markovejnovic markovejnovic commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

No description provided.

Stage the documentation and configuration work split out of the larger
get-a-vm-running branch into its own PR off main:

- docs/cookbook: rewritten intro/install + new config.md, documenting the
  /etc/hyper/config.toml [tools] and [jails] tables, the [tools] node-tool
  paths, and the User Configuration / cgroup setup.
- mix.exs/mix.lock: makeup_syntect + a docs alias step that aliases bash/sh
  fences to the shell grammar, so cookbook code blocks highlight.
- config/runtime.exs: optional /etc/hyper/config.exs operator override.
- lib/hyper/config.ex + umoci.ex: the [tools]/[jails] config reading these
  docs describe.

Note: this branch is a content snapshot off main; it intentionally diverges
from main's behavior (the supporting Rust/test changes live on the other
branch), so it is not expected to build/test green on its own.
@codecov

codecov Bot commented Jun 26, 2026

Copy link
Copy Markdown

@github-actions

github-actions Bot commented Jun 26, 2026

Copy link
Copy Markdown

Test Results

296 tests  +46   295 ✅ +46   4s ⏱️ -1s
 55 suites + 6     1 💤 ± 0 
  2 files   ± 0     0 ❌ ± 0 

Results for commit 0430419. ± Comparison against base commit 3603c45.

♻️ This comment has been updated with latest results.

Creates Hyper.Cfg.Dirs with work_dir/0 (config.toml-only, default
/srv/hyper) and all 8 derived directory accessors. Migrates every
call-site away from Hyper.Config.*; removes now-unused aliases in
img.ex, oci_loader.ex, umoci.ex. Resolves the last undefined-accessor
warning: firecracker_install_dir/0.
Delete the now-redundant Hyper.Config module (all accessors have been
re-homed under Hyper.Cfg.*). Migrate the two test files that still
referenced it, and remove the three dead flat keys (cgroup_parent,
uid_gid_range, layer_dir) from config/config.exs that were never read
via Application.get_env.
Rename and relocate Hyper.Node.Config.Budget to Hyper.Cfg.Budget,
update the runtime.exs app-env key, and fix all aliases/call-sites.
Delete the hardcoded @period_ms/@tau_s module attributes from the four
/proc monitors and replace period/0 + tau/0 with delegations to the new
Hyper.Cfg.Mon module. Operators can now override sampling cadence per
metric via config :hyper, Hyper.Cfg.Mon, cpu: [period_ms: .., tau_s: ..].
- alphabetize aliases in node_state.ex/gc.ex/tools_test.exs (credo --strict)
- mix format the longer Hyper.Cfg.* call-sites (oci_loader.ex, img/server.ex)
- restore anti-thrash rationale comment in layer/server.ex moduledoc
- add Jails.range_from/1 non-integer-list refusal test
- drop unused Hyper.Cfg.Toml.path/0 (YAGNI)
… modules

- runtime.exs: add cpu_max_cap default to Budget block
- mix format the phase-2 modules (drift from subagent commits)
- credo: sigil @doc in Unit.Time, alphabetize aliases in img/vm_linux tests
…; doc grpc adapter_opts

- drop Gc.enabled: the layer GC is core, always runs (Img.Db.Gc.init always starts)
- Hyper.Cfg.Mon no longer reads runtime config; sampling cadence is a fixed internal
- document the gRPC adapter_opts field
Split the numeric prefix from the suffix with Integer.parse/1 and validate the
suffix by map lookup, replacing the anchored-alternation regex whose ns|us|ms|s|m|h
ordering relied on backtracking. Same accepted/rejected inputs.
… tools_test

- parse suites: one generated test per suffix/reject case (data-table driven)
- toml: parametrize fetch_in traversal cases
- vm_linux: keep only the arch-atom mapping + unconfigured-arch omission
  (precedence is covered generically by resolver_test)
- delete tools_test: every case duplicated resolver_test's generic resolution
- parse suites: one generated test per suffix/reject case (data-table driven)
- toml: parametrize fetch_in traversal cases
- vm_linux: keep only the arch-atom mapping + unconfigured-arch omission
  (precedence is covered generically by resolver_test)
…Cfg.Mon

The cadence is a fixed internal of the monitoring subsystem, not operator
config. Each monitor now owns its prime period + EWMA tau directly instead of
routing through a thin config module.
…per.Cfg.Timeouts

Timeouts was an artificial grab-bag of unrelated values. The idle-grace now
lives in each server (img/layer/mutable) and the per-call cap in the Firecracker
client, beside the behavior each governs.
- drop the {900_000, 999_999} default band: operators must declare the
  uid/gid range; absent -> MissingError, non-integer pair -> ArgumentError
- strip Honeycomb specifics from Otel: endpoint comes from the standard
  OTEL_EXPORTER_OTLP_ENDPOINT env var, headers only from config
resolver_test already covers generic get_cfg precedence/MissingError, and the
unit parse suites cover Unit parsing. Delete tests that merely re-ran that glue
(facades, img_db, gc, dirs, img); trim grpc to its cred coercion and budget to
its toml-string coercion + required-field error.
Configure clustering under config :hyper, Hyper.Cfg.Cluster, topologies: [...]
(config.exs-only, libcluster syntax forwarded straight through) instead of
leaking raw config :libcluster into operator config. Default [] = single node.
Documents the previously-TODO Cluster Topology section.
Otel resolves config.exs from an explicit keyword (it runs during runtime.exs
boot, before app env exists) — the one resolution path not expressed by get_cfg.
Add an {:exs, {kw, key}} source so that case lives in the central resolver; the
bespoke 13-line pick/3 becomes a one-line delegate.
…sted

Budget.load just calls Unit.{Information,Bandwidth}.parse! on TOML strings; the
"4GiB"/"1GiBps" coercion it asserted is covered by the parametrized parse
suites in test/unit. Nothing Budget-specific was left worth a dedicated file.
- work_dir default is /srv/hyper, store default is <work_dir>/layers (were '-')
- budget: cpu/disk_bw/net_bw are all $\beta$ (soft) per architecture.md;
  cpu_max_cap/disk_bw_max_load/net_bw_max_load were mislabelled $\alpha$
- budget: cpu_max_load/cpu_max_cap/*_max_load are floats (load fraction / core
  count), not [unit] quantities; cpu_max_cap is optional (default nil)
- img.db: keys override the repo's compiled-in config, no 'hyper' default
- mark jails uid_gid_range required; drop 'large set of flags' overstatement
- typos: exclusively, compile-time config.exs
@markovejnovic markovejnovic changed the title docs(cookbook): config.toml [tools]/[jails], cookbook, and doc highlighting chore: config improvements Jun 27, 2026
@markovejnovic markovejnovic marked this pull request as ready for review June 27, 2026 02:04
@markovejnovic markovejnovic merged commit 9ee5de4 into main Jun 27, 2026
6 checks passed
@markovejnovic markovejnovic deleted the docs/cookbook-and-config branch June 27, 2026 02:04
markovejnovic added a commit that referenced this pull request Jun 27, 2026
origin/main (#32) refactored Hyper.Config into Hyper.Cfg.* modules
(Cfg.Tools/Jails/Dirs/Budget/Otel/Toml/...) and deleted config.ex. This
branch had independent VM-boot work on the same files. Resolution:

- config.ex: accept main's deletion; rewrite all Hyper.Config.X callers to
  the Hyper.Cfg.{Tools,Jails,Dirs,Img}.Y equivalents (jailer, node, reclaim,
  dmsetup).
- suid_helper/{blockdev,dmsetup,losetup}, jailer: keep THIS branch's
  helper-routed architecture (no --bin; the merged Rust helper reads tool
  paths from config and owns the privileged jailer flags).
- node.ex: keep check_firecracker_bins + dropped FireVMM.Provider (branch),
  but load budget via Hyper.Cfg.Budget (main).
- fire_vmm/provider.ex: stays deleted (branch dropped Provider).
- umoci.ex, runtime.exs, config.md: take main (already carry these features,
  refactored; config.md is main's comprehensive restructure).
- jailer_test: stub via Hyper.Cfg.Toml.put_cache/reload.

Gate green: compile --warnings-as-errors, format, 250 tests, dialyzer 0.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant